﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Speech.AudioFormat;
//using System.Speech.Recognition;
//using System.Text;
//using System.Windows;
//using Microsoft.Kinect;

//namespace SVU.Managers
//{
//    public class AudioManager
//    {
//        public static void RecognizeSpeech(KinectSensor sensor)
//        {

//            KinectAudioSource audioSource = new KinectAudioSource(sensor, null);

//            {
//                audioSource.FeatureMode = true;
//                audioSource.AutomaticGainControl = false;
//                audioSource.SystemMode = SystemMode.OptibeamArrayOnly;

//                RecognizerInfo ri = GetKinectRecognizer();
//                var speechRecognitionEngine = new SpeechRecognitionEngine(ri.Id);

//                speechRecognitionEngine.LoadGrammar(new DictationGrammar());
//                speechRecognitionEngine.SpeechRecognized += (s, args) => MessageBox.Show(args.Result.Text);

//                using (var s = audioSource.Start())
//                {
//                    speechRecognitionEngine.SetInputToAudioStream(s,
//                                                                  new SpeechAudioFormatInfo(EncodingFormat.Pcm, 16000,
//                                                                                            16, 1, 32000, 2, null));
//                    speechRecognitionEngine.RecognizeAsync(RecognizeMode.Multiple);
//                }
//            }
//        }
//    }
//}
